#ifndef SUPER_TOOL_LIBRARY_H
#define SUPER_TOOL_LIBRARY_H

#include <string>
#include "common.h"

using namespace std;

namespace supertool {

    class SuperTool {
    public:
        // 删除复制构造函数和赋值操作符
        SuperTool(const SuperTool &) = delete;

        SuperTool &operator=(const SuperTool &) = delete;

        static SuperTool &getInstance() {
            static SuperTool instance;  // Guaranteed to be destroyed, instantiated on first use.
            return instance;
        }

        void init();

        // 测试周期性消息使用
        void set_callbackInterval(int32_t callbackInterval);

        // 测试周期性消息使用
        int32_t get_callbackInterval();

        void set_callback(shared_ptr<supertool::WsCallback> callback);


    private:
        bool _init = false;

        int32_t callbackInterval_ = 5;  //回调间隔, 毫秒
        void timerTask();

        SuperTool() {}  // 构造函数是私有的
    };

}  // namespace supertool

#endif //SUPER_TOOL_LIBRARY_H
